import 'package:flutter/material.dart';
import './jingsai/answers.dart';


class Jingsai extends StatefulWidget {
  Jingsai({Key key}) : super(key: key);

  _JingsaiState createState() => _JingsaiState();
}

class _JingsaiState extends State<Jingsai> {
    
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text('知识竞赛'),
      ),
      body: Stack(
        children: <Widget>[
          Container(
            child: Image.asset('images/bj2.jpg'),
          ),
          Container(
            width: 330,
            height: 100,
            margin: EdgeInsets.fromLTRB(15, 15, 0, 0),
            decoration: BoxDecoration(
              color: Colors.white,
              border: Border.all(width: 1, color: Colors.grey),
              borderRadius: BorderRadius.all(Radius.circular(6.0)),
            ),
            child: Row(
              children: <Widget>[
                Expanded(
                  flex: 1,
                  child: Column(
                    children: <Widget>[
                      SizedBox(
                        height: 20,
                      ),
                      Text('奖励积分',style: TextStyle(color: Color.fromRGBO(206, 206, 206, 1)),),
                      SizedBox(
                        height: 20,
                      ),
                      Text('--')
                    ],
                  ),
                ),
                Container(
                  width: 1,
                  height: 55,
                  color: Color.fromRGBO(220, 220, 220, 1),
                ),
                Expanded(
                  flex: 1,
                  child: Column(
                    children: <Widget>[
                      SizedBox(
                        height: 20,
                      ),
                      Text('答题次数',style: TextStyle(color: Color.fromRGBO(206, 206, 206, 1)),),
                      SizedBox(
                        height: 20,
                      ),
                      Text('1'),
                    ],
                  ),
                )
              ],
            ),
          ),
          Container(
            width: 330,
            height: 265,
            margin: EdgeInsets.fromLTRB(15, 125, 0, 0),
            decoration: BoxDecoration(
              color: Colors.white,
              border: Border.all(width: 1, color: Colors.grey),
              borderRadius: BorderRadius.all(Radius.circular(6.0)),
            ),
            child: ListView(
              children: <Widget>[
                SizedBox(
                  height: 10,
                ),
                InkWell(
                  child: ListTile(
                    leading: Image.asset('images/t3.png'),
                    title: Text('每日答题'),
                    subtitle: Text('早晨起来，拥抱太阳'),
                  ),
                  onTap: () {
                     Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) => Answers(title: '每日答题',)));
                  },
                ),
                Row(
                  children: <Widget>[
                    SizedBox(
                      width: 20,
                    ),
                    Container(
                      height: 1,
                      width: 290,
                      color: Color.fromRGBO(220, 220, 220, 1),
                    ),
                  ],
                ),
                SizedBox(
                  height: 10,
                ),
                InkWell(
                  child: ListTile(
                    leading: Image.asset('images/t2.png'),
                    title: Text('每周答题'),
                    subtitle: Text('周而复始，如期而至'),
                  ),
                  onTap: () {
                    Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) => Answers(title: '每周答题',)));
                  },
                ),
                Row(
                  children: <Widget>[
                    SizedBox(
                      width: 20,
                    ),
                    Container(
                      height: 1,
                      width: 290,
                      color: Color.fromRGBO(220, 220, 220, 1),
                    ),
                  ],
                ),
                SizedBox(
                  height: 10,
                ),
                InkWell(
                  child: ListTile(
                    leading: Image.asset('images/t4.png'),
                    title: Text('专项答题'),
                    subtitle: Text('术业有专攻，道亦有经论'),
                  ),
                  onTap: () {
                    Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) => Answers(title: '专项答题',)));
                  },
                )
              ],
            ),
          ),
          Container(
              width: 330,
              height: 75,
              margin: EdgeInsets.fromLTRB(15, 410, 0, 0),
              decoration: BoxDecoration(
                color: Colors.white,
                border: Border.all(width: 1, color: Colors.grey),
                borderRadius: BorderRadius.all(Radius.circular(6.0)),
              ),
              child: InkWell(
                child: ListTile(
                  leading: Image.asset('images/t1.png'),
                  title: Text('挑战答题'),
                  subtitle: Text('挑战你的能力，超越自己'),
                ),
                onTap: () {
                  Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) => Answers(title: '挑战答题',)));
                },
              )),
        ],
      ),
    );
  }
}


class AS extends StatefulWidget {
  AS({Key key}) : super(key: key);

  @override
  _ASState createState() => _ASState();
}

class _ASState extends State<AS> {
  @override
  Widget build(BuildContext context) {
    return Container(
       child: Text('data'),
    );
  }
}